<?php
class a_base extends CI_Controller{
    public function __construct(){
        parent::__construct();
        $session_info = $this->session->all_userdata();
        if($session_info['user_id'] == 0 && $session_info['user_name'] == ''){
            header('location:http://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'].'/login');
        }
    }
}
?>